home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 3
/
Amiga Tools 3.iso
/
rexx
/
cropmarks.pvrx
< prev
next >
Wrap
Text File
|
1995-02-28
|
4KB
|
184 lines
/*
* This macro prompts the user to drag a box on the project which is
* the boundary to which crop marks will be drawn. Crop marks,
* registration marks, and plate names will be drawn, all in the layer
* named "Crop Marks"
*
* This macro hopes that colors named Black, Cyan, Yellow, Magenta and
* 100% CMYK are present in the project, and that their values correspond
* to their names. This, of course, is the default for ProVector 3.0
* newly created projects.
*
* Author:
* Ross Cunniff, Stylus, Inc.
* February 24, 1995
*/
Address "ProVector"
arg arglist
Cmd = word(arglist,1)
Options Results
'Lock Wait'
if Cmd = 'MENU' then do
/* Called from the menu */
'Prompt "Drag crop boundaries"'
'GetUserData 2 2 2 "CropMarks OK" ""'
end
else if Cmd = 'OK' then do
'EndPrompt'
'GetInputPoints Pts'
PX1 = Pts.0.X; PY1 = Pts.0.Y
PX2 = Pts.1.X; PY2 = Pts.1.Y
'GetPageSize PSize'
Size = 0.5
if PSize.X1 > PSize.X2 then do
DX = -Size
if PX1 < PX2 then do
TX = PX1; PX1 = PX2; PX2 = TX
end
end
else do
DX = Size
if PX1 > PX2 then do
TX = PX1; PX1 = PX2; PX2 = TX
end
end
if PSize.Y1 > PSize.Y2 then do
DY = -Size
if PY1 < PY2 then do
TY = PY1; PY1 = PY2; PY2 = TY
end
end
else do
DY = Size
if PY1 > PY2 then do
TY = PY1; PY1 = PY2; PY2 = TY
end
end
EdgeWeight = 0.25 / 72.0
EdgeColor = 0
BlackColor = 0
CyanColor = 5
MagentaColor = 7
YellowColor = 3
/* Find the appropriate colors */
'NumColors'; NumC = Result
do i = 0 to NumC-1
'GetColorName i'; Name = Result
if Name = "Black" then BlackColor = i
if Name = "Cyan" then CyanColor = i
if Name = "Magenta" then MagentaColor = i
if Name = "Yellow" then YellowColor = i
if Name = "100% CMYK" then EdgeColor = i
end
'CurrentLayer'; OldLayer = Result
'DeleteLayer "Crop Marks"'
if RC ~= 0 then do
call Open( zzz, "CON:" )
call Writeln( zzz, "DeleteLayer failed!" )
call Writeln( zzz, RC )
end
'CreateLayer "Crop Marks"'
'CurrentLayer "Crop Marks"'
call DrawCropMark( PX1, PY1, DX, DY )
call DrawCropMark( PX1, PY2, DX, -DY )
call DrawCropMark( PX2, PY1, -DX, DY )
call DrawCropMark( PX2, PY2, -DX, -DY )
call DrawRegMark( PX1 - DX / 2.0, (PY1 + PY2) / 2.0, Size*0.4 )
call DrawRegMark( PX2 + DX / 2.0, (PY1 + PY2) / 2.0, Size*0.4 )
call DrawRegMark( (PX1 + PX2) / 2.0, PY1 - DY / 2.0, Size*0.4 )
call DrawRegMark( (PX1 + PX2) / 2.0, PY2 + DY / 2.0, Size*0.4 )
call DrawColorPlate( PX1 , PY1, DX, DY, "C", CyanColor )
call DrawColorPlate( PX1+ DX, PY1, DX, DY, "M", MagentaColor )
call DrawColorPlate( PX1+2.0*DX, PY1, DX, DY, "Y", YellowColor )
call DrawColorPlate( PX1+3.0*DX, PY1, DX, DY, "K", BlackColor )
'CurrentLayer OldLayer'
'Repair'
end
'UnLock'
exit
DrawCropMark: procedure expose EdgeWeight EdgeColor
arg PX, PY, DX, DY
Pts.0.X = PX
Pts.0.Y = PY - DY
Pts.1.X = PX
Pts.1.Y = PY - DY / 8.0
'Polyline 2 Pts'; Obj = Result
'ChangeEdgeType Obj 1'
'ChangeEdgeWidth Obj EdgeWeight'
'ChangeEdgeVal Obj EdgeColor'
Pts.0.X = PX - DX
Pts.0.Y = PY
Pts.1.X = PX - DX / 8.0
Pts.1.Y = PY
'Polyline 2 Pts'; Obj = Result
'ChangeEdgeType Obj 1'
'ChangeEdgeWidth Obj EdgeWeight'
'ChangeEdgeVal Obj EdgeColor'
return
DrawRegMark: procedure expose EdgeWeight EdgeColor
arg PX, PY, Rad
Pts.0.X = PX - Rad
Pts.0.Y = PY
Pts.1.X = PX + Rad
Pts.1.Y = PY
'Polyline 2 Pts'; Obj = Result
'ChangeEdgeType Obj 1'
'ChangeEdgeWidth Obj EdgeWeight'
'ChangeEdgeVal Obj EdgeColor'
Pts.0.X = PX
Pts.0.Y = PY - Rad
Pts.1.X = PX
Pts.1.Y = PY + Rad
'Polyline 2 Pts'; Obj = Result
'ChangeEdgeType Obj 1'
'ChangeEdgeWidth Obj EdgeWeight'
'ChangeEdgeVal Obj EdgeColor'
Rad = Rad * 0.75
'Arc PX PY Rad Rad 0 360'; Obj = Result
'ChangeFillType Obj 0'
'ChangeEdgeType Obj 1'
'ChangeEdgeWidth Obj EdgeWeight'
'ChangeEdgeVal Obj EdgeColor'
return
DrawColorPlate: procedure
arg PX, PY, DX, DY, Char, Color
DX = DX / 4.0
DY = DY / 2.0
PX = PX + DX
PY = PY - DY
'Text Char PX PY DX DY 0'; Obj = Result
'ChangeFillType Obj 1'
'ChangeEdgeType Obj 1'
'ChangeFillVal Obj Color'
'ChangeEdgeVal Obj Color'
'ChangeEdgeWidth Obj 0'
return